<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div class="box">
        <span>我是小n:{{n}}</span><br>
        我是放大10倍后的:<span v-big="n"></span><br>
        我是缩小10倍后的:<span v-small="n"></span>

    </div>
    <script>
        //过滤器
        vue.filter('myslice',function(){
                return splice(0,4)
            })
        const vm = new Vue({
            el:'.box',
            data:{
                n:1
            },
            directives:{
                big(element,binding){
                    element.innerText = binding.value *10
                },
                //第一个是元素，第二个是数据
                small(element,binding){
                    element.innerText = binding.value /10
                }
            }
        })
    </script>
</body>
</html>